import request from '@/utils/request';

// 获取评论列表
export function getCommentList(params: any) {
    return request({
        url: '/api/comment',
        method: 'get',
        params
    });
}

// 获取评论详情
export function getCommentDetail(id: number) {
    return request({
        url: `/api/comment/${id}`,
        method: 'get'
    });
}

// 创建评论
export function createComment(data: any) {
    return request({
        url: '/api/comment',
        method: 'post',
        data
    });
}

// 更新评论
export function updateComment(data: any) {
    return request({
        url: `/api/comment/${data.id}`,
        method: 'put',
        data
    });
}

// 删除评论
export function deleteComment(id: number) {
    return request({
        url: `/api/comment/${id}`,
        method: 'delete'
    });
}

// 批量删除评论
export function batchDeleteComment(ids: number[]) {
    return request({
        url: '/api/comment/batch',
        method: 'post',
        data: ids
    });
}

export function getStudentList() {
    return request({
        url: '/api/comment/student',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}

export function getTeacherList() {
    return request({
        url: '/api/comment/teacher',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}
